package com.ruoyi.dynamic.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.dynamic.mapper.RoomPostMapper;
import com.ruoyi.dynamic.model.pojo.entity.Room;
import com.ruoyi.dynamic.model.pojo.entity.RoomPost;
import com.ruoyi.dynamic.service.IRoomPostService;
import com.ruoyi.dynamic.service.IRoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import java.util.List;
import java.util.Optional;

/**
 * <p>
 * 房间职位 服务实现类
 * </p>
 *
 * @author Gnc
 * @since 2025-01-14
 */
@Service
public class RoomPostServiceImpl extends ServiceImpl<RoomPostMapper, RoomPost> implements IRoomPostService {
    @Autowired
    private IRoomService iRoomService;
    @Override
    public RoomPost verify(Long id) {
        Optional<RoomPost> roomPost = lambdaQuery().eq(RoomPost::getId, id).oneOpt();
        Assert.isTrue(roomPost.isPresent(), "此职位不存在");
        return roomPost.get();
    }


}
